package com.condroid;

import ioio.lib.api.Uart;

import java.io.OutputStream;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;

/**
 * The class content most constant data and interacting data.
 * Refer to "Write a Console App on Android using Java" by Chilap 
 * {@link http://www.codeproject.com/KB/android/cmdconsole.aspx}
 * @author JUN GAO
 * Condroid Summer CSD 2011 - KTH
 */
public class ConstantData {

private ConstantData() { }
	
//	public static final String ROOTDIR = "/";
//	public static final String DIRSEPARATOR = "/";
//	public static final char DIRSEPCHAR = '/';
	public static final String NEWLINE = "\n";
	
//	public static final String STREAMENCODING = "UTF-8";
//	
//	public enum MsgType
//	{
//	   STRING, // display string
//	   CLEAR,  // clear screen
//	   SHOWSRES, // show screen resolution
//	   SETFONTSIZE, // set new font size 
//	   SHOWFONTSIZE, // show current font size
//	   EXIT    // quit console
//	};
	
	/**
	 * Font size in the output console
	 */
	public enum ConsoleFontSize
	{
	   UNKNOWN(-1),
	   BIG(20),
	   MEDIUM(16),
	   SMALL(12);
	   
	   private final int size;   ///< actual font size
	   ConsoleFontSize(int s)
	   {
	      this.size = s;
	   }
	      
	   public int v()
	   {
	      return this.size;
	   }
	   
	   public static ConsoleFontSize toFontSize(int size)
	   {
		  for (ConsoleFontSize f : ConsoleFontSize.values()) {
			 if (f.v() == size)
				return f;
		  }
		  
		  return UNKNOWN;
	   }
	};
	
	/*My constant data*/
	
	/**Link Type*/
	public enum ControlType{
		CONSOLE,
		SMS,
		CALL,
		INTERNET,
	}
	
	
	/**Command Type*/
	public static final int OUTERCMD = 1;
	public static final int SHTCUTCMD = 2;
	public static final int INNEREXECMD = 3;
	
	/**Exchange Info*/
	public static BroadcastReceiver smsReceiver = null;
	public static IntentFilter smsFilter = null;
	public static SMSDealer smsDealer = null;
	public static InUartThread consoleInUartThread = null;
	public static OutputStream consoleOutStream = null;
	public static Uart consoleUart = null;
	public static UartInfo consoleUartInfo = null;
	public static Activity mainActivity = null;
	public static Context appContext = null;
	public static String phoneNo;
}
